import pygame
import images
from constant import *

class Result :
    def __init__(self, type, id) :
        self.id = id
        self.type = type
        self.screen_position = self.__findScreenPosition__()
        
    def __findScreenPosition__(self) :
        x, y = images.RESULT_START_X, images.RESULT_START_Y
        x += self.id * (images.SPRITE_RESULT + images.RESULT_DIFF)
        return (x, y)
        
    def paint(self, screen) :
        sprite = images.getImageResult(self.type)
        screen.blit(sprite, self.screen_position)
        
    def setType(self, type) :
        self.type = type
       
    def setScreenPosition(self, screen_position) :
        self.screen_position = screen_position
        
    def downPosition(self) :
        self.screen_position = (self.screen_position[0],self.screen_position[1] + images.SPRITE_RESULT + 12)        
      
    def isCorrect(self) :
        return self.type == CORRECT